package 编译原理实验.编译原理第二次实验;
import java.util.Scanner;
import java.util.Arrays;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int nums[] = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = scanner.nextInt();
        }
        System.out.println(score(nums));
    }

    public static int score(int nums[]) {
        int num[] = new int[nums.length];
        int index = 0;
        for (int i = 1; i < nums.length; i++) {
            num[index++] = Math.abs(nums[i] - nums[i - 1]);
        }
        Arrays.sort(num);
        return num[num.length - 2];
    }
}